#!/bin/bash

# 获取镜像名称和标签
source image_version.sh

# 构建 Docker 镜像
echo "删除旧的 Docker 镜像..."
docker rmi ${PULL_IMAGE_NAME}:${PULL_IMAGE_TAG}

echo "开始构建 Docker 镜像..."
docker build -t ${PULL_IMAGE_NAME}:${PULL_IMAGE_TAG} \
    --build-arg IMAGE=${PULL_IMAGE_NAME} \
    --build-arg VERSION=${PULL_IMAGE_TAG}  \
    --build-arg VCS_REF=`git rev-parse --short HEAD` \
    --build-arg VCS_URL=`git config --get remote.origin.url` \
    --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
.

